﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Profile;
using COFE.Core;
using COFE.Core.Utils;

namespace COFE.Core.Lister
{
    public abstract class PrimaryDirectoryListerBase : DirectoryListerBase, IPrimaryDirectoryLister
    {
        #region Constructors

        protected PrimaryDirectoryListerBase(IFactory<IDirectoryLister> factory, string listerKey)
            : base(factory, listerKey)
        {
            Status = DirectoryListerStatusMode.Fixed;
        }

        #endregion

        #region Methods

        public IFileSystemInfo ParsePath(string path, EntryConstructionFlags flags)
        {
            return _parse(path, flags);            
        }

        #endregion


        #region Data


        protected Func<IDirectoryInfo[]> _getRootDirectory = () => { return new IDirectoryInfo[] { }; };
        protected Func<string[]> _getSupportedPathPatterns = () => { return new string[] { }; };
        protected Func<string> _getTempPath = () => { return null; };
        protected Func<string, EntryConstructionFlags, IFileSystemInfo> _parse = (path, flags) => { return null; };

        #endregion

        #region Public Properties

        public virtual DirectoryListerStatusMode Status { get; protected set; }
        
        public IDirectoryInfo[] RootDirectories { get { return _getRootDirectory(); } }
        public string[] SupportedPathPatterns { get { return _getSupportedPathPatterns(); } }
        public string RootTempPath { get { return _getTempPath(); } }

        #endregion


        
    }
}
